ArcPy and ArcGIS - Second Edition by Second Edition

ArcPy and ArcGIS - Second Edition by Second Edition

Author:Second Edition [Edition, Second]
Language: eng
Format: epub
Published: 0101-01-01T00:00:00+00:00


One optional adjustment would be to add an arcpy.AddMessage line where the average population is calculated. By doing this, the individual block population would be displayed, and the script console would give feedback about the progress of the script.

Insert the following in the script just after the line where the variable finalData is defined:

finalData = busStopLine, busStopID, averagePop arcpy.AddMessage(finalData)

The feedback provided by this line will make it obvious that the script is working, which is useful when the script executes a long analysis. When performing a long analysis, it is good practice to provide feedback to the user so that they can see that the script is working as expected. Pass newline characters n as parameters to arcpy.AddMessage when there is a large amount of data being passed to arcpy.AddMessage. This will break up the data into discrete chunks, and make it easier to read.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.